//
//  ThingsTodo.swift
//  VenusTodo
//
//  Created by 文显庆 on 2021/10/7.
//

// 事件类
import SwiftUI
import CoreLocation


struct ThingsTodo: Identifiable, Hashable, Codable {
    
    //如果是打卡任务
    var isDone: Bool = false
    //如果是定量任务
    var target: Int = 0 // 目标进度
    var progress: Int = 0 //当前进度
    
    var id : Int //每个任务分配一个唯一ID
    var name: String //任务名称
    var type = 0 //任务类型
    var startDate: Date = Date()  //任务开始日期
    var endDate: Date = Date()    //任务结束如期
    var formatedDateStart = "" //格式化后的开始日期
    var formatedDateEnd = "" //格式化后的结束日期
    var additional: String = ""//说明信息
    var taskIndex: Int = 0
    var colorIndex: Int = 0  //添加任务时的辅助变量
}
var id_tag = 4
var Things: [ThingsTodo] = [] //用于存储用户的所有任务
var thingDefault = ThingsTodo(isDone: true, id: 0, name: "默认", type: 0, startDate: Date(), endDate: Date()   ) //默认任务，用户调试
var TaskTypes = ["定量任务", "打卡任务"] //任务类型数组
var colors = [Color.blue, Color.purple, Color.red, Color.pink, Color.black, Color.orange] //颜色数组

/*
 ThingsTodo(id: 1,  name: "吃饭", isDone: true, startYear: 2021, startMonth: 10, startDay: 2, startHour: 1, startMinute: 59, startSecond: 30, endYear: 2021, endMonth: 10, endDay: 2, endHour: 4, endMinute: 20, endSecond: 50),
 ThingsTodo(id: 2, name: "睡觉", isDone: false, startYear: 2021, startMonth: 10, startDay: 4, startHour: 3, startMinute: 11, startSecond: 30, endYear: 2021, endMonth: 10, endDay: 7, endHour: 4, endMinute: 45, endSecond: 00),
 ThingsTodo(id: 3, name: "LOL", isDone: false, startYear: 2021, startMonth: 10, startDay: 3, startHour: 7, startMinute: 59, startSecond: 30, endYear: 2021, endMonth: 10, endDay: 8, endHour: 4, endMinute: 20, endSecond: 50 )
 */
